package com.xiaowu.datajpa.dao;

import com.xiaowu.datajpa.entity.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface TeacherRepository extends JpaRepository<Teacher,Integer> {
    /**
     * 根据名字模糊查询
     * @param name
     * @return
     */
    List<Teacher> findByNameLike(String name);

    /**
     * 根据名字和密码查询
     * @param name
     * @param password
     * @return
     */
    List<Teacher> findByNameAndPassword(String name, String password);

    /**
     * 根据教师编号查询
     * @param teachernum
     * @return
     */
    Teacher findByTeachernum(String teachernum);
}
